#ifndef BANKING_SYSTEM_HH
#define BANKING_SYSTEM_HH

#include <vector>
#include <string>
#include <algorithm>
#include "customer.hh"

namespace MiniBank
{

    class BankingSystem
    {
    private:
        std::vector<Customer> customers;


    public:
        void registerCustomer(const std::string& name, double initialBalance_saving, double initialBalance_checking);
        void accessCustomerAccounts(const std::string& name);
        void displayAllAccounts() const;
        void generateGlobalTransactionReport() const;
        int GetChoice(int Left, int Right);
        std::string generateUniqueAccountID(const std::string& accountType);
        void Transfer_savings(Account& target, SavingsAccount& savings);
        void View_transaction_history_savings(SavingsAccount& savings);
        void Generate_bank_account_report_savings(SavingsAccount& savings);
        void Deposit(CheckingAccount& checking);
        void Withdraw(CheckingAccount& checking);
        void Transfer_checking(CheckingAccount& checking);
        void View_transaction_history_checking(CheckingAccount& checking);
        void Generate_bank_account_report_checking(CheckingAccount& checking);
    };

    bool name_matches(const Customer& customer, const std::string& name);

    // Define a function object, which takes a Customer object and returns a bool value
    class NameMatcher
    {
    public:
        std::string name_to_find;

        NameMatcher(std::string name) : name_to_find(name) {}

        bool operator()(const Customer& customer) const
        {
            return name_matches(customer, name_to_find);
        }
    };

    bool id_matches(Customer& customer, const std::string& targetID);

    // Define a function object, which takes a Customer object and returns a bool value
    class IDMatcher
    {
    public:
        std::string id_to_find;

        IDMatcher(std::string targetID) : id_to_find(targetID) {}

        bool operator()(Customer& customer) const
        {
            return id_matches(customer, id_to_find);
        }
    };
}

#endif
